Two threads working on shared data